<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <link rel="stylesheet" href="/Examination/assets/elem-ui/node_modules/element-ui/lib/theme-chalk/index.css"/>
    <script src="/Examination/assets/vue/node_modules/vue/dist/vue.js"></script>
    <script src="/Examination/assets/elem-ui/node_modules/element-ui/lib/index.js"></script>
    <script src="/Examination/assets/axios/node_modules/axios/dist/axios.js"></script>
    <script src="/Examination/js/ajax/api.js"></script>
    <script src="/Examination/js/record.js"></script>
</head>
<style>
    .card{
        margin: 50px auto;
        width: 1250px;
        max-height: 650px;
        border-radius: 15px;
    }
</style>

<body>
<div id="app">
    <div>
        <template>
            <el-card shadow="always" class="card">


                <el-table
                        :data="userData"
                        v-loading="loading"
                        style="width: 1200px;"
                        max-height="550">
                    <el-table-column
                            fixed
                            prop="userCode"
                            label="学号">
                    </el-table-column>
                    <el-table-column
                            prop="userName"
                            label="姓名">
                    </el-table-column>
                    <el-table-column
                            prop="sexFlagName"
                            label="性别">
                    </el-table-column>
                    <el-table-column
                            prop="majorName"
                            label="专业">
                    </el-table-column>
                    <el-table-column
                            prop="classCode"
                            label="班级"
                    >
                    </el-table-column>

                    <el-table-column
                            fixed="right"
                            label="操作"
                            width="120">
                        <template slot-scope="scope">
                            <div>
                                <el-button
                                        @click.native.prevent="deleteRow(scope.row)"
                                        type="text"
                                        :disabled="scope.row.checkFlag==1"
                                        size="small">
                                    通过审核
                                </el-button>
                                <br/>
                                <el-button
                                        @click.native.prevent="resetpwdRow(scope.row)"
                                        type="text"
                                        :disabled="scope.row.checkFlag==0"
                                        size="small">
                                    重置密码
                                </el-button>
                            </div>

                        </template>
                    </el-table-column>
                </el-table>
            </el-card>
        </template>

    </div>
</div>
<script>

    new Vue({
        el: '#app',
        data: {
            loading:true,
            userData: [{
                date: '2016-05-03',
                name: '王小虎',
                province: '上海',
                city: '普陀区',
                address: '上海市普陀区金沙江路 1518 弄',
                zip: 200333
            },]

        },
        methods: {
            deleteRow(index, rows) {
                console.log(index,rows)
            }
        },
        beforeCreate() {
            //第一个生命周期函数，实例未创建即执行，不能操作data与methods
            api.get("Student/api/Student/GetClass"
            ).then(res=>{
                console.log(res)
                // if(res.status){
                //     this.userData=res.data;
                //     this.loading=false;
                // }else{
                //     this.$message.error('数据加载出错');
                // }
            }).catch(res=>{
                this.$message.error('服务器出错了，请联系负责人');
            })

        },
        created() {
            //最早能操作data与methods的方法

        },
        beforeMount() {
            //页面在内存中编辑完成，js内容尚未渲染到页面
            console.log("beforeMount");
        },
        mounted() {
            //内存中的模板已经挂载到页面中，页面渲染完成。
            console.log("mounted");
        }
    })
</script>
<script>


</script>
</body>
</html>
